<template>
  <div id="parTopSearch">
    <h1 class="con-right-title">
      通知公告
    </h1>
    <div class="search-box">
      <el-form
        ref="ruleForm"
        :inline="true"
        :model="formInline"
        class="demo-form-inline"
      >
        <el-form-item label="公告标题" prop="configName">
          <el-input v-model="formInline.configName"></el-input>
        </el-form-item>
        <el-form-item label="操作人员" prop="configName">
          <el-input v-model="formInline.configName"></el-input>
        </el-form-item>
        <el-form-item label="公告类型" prop="configName">
          <el-select v-model="formInline.checkContext" placeholder="所有">
            <el-option
              v-for="item in statusList"
              :key="item.key"
              :label="item.key"
              :value="item.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item class="s-btn">
          <el-button
            type="success"
            icon="el-icon-search"
            @click="toSearch('ruleForm')"
          >
            查询
          </el-button>
          <el-button type="success" plain @click="reset">
            重置
          </el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
export default {
  name: 'postTopSearch',
  msg: '岗位管理-顶部搜索',
  props: {
    formInline: {
      type: Object,
      default: function() {
        return {}
      }
    }
  },
  data() {
    return {
      statusList: [
        // 用户状态
        { key: '全部', value: 0 },
        { key: '正常', value: 1 },
        { key: '停用', value: -1 }
      ]
    }
  },
  mounted() {},
  methods: {
    /* 搜索 */
    toSearch(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          this.$emit('toSearch')
        } else {
          return false
        }
      })
    },
    /* 重置 */
    reset() {
      this.$refs['ruleForm'].resetFields()
    },
    /* 获取用户状态 */
    getStatusList() {}
  }
}
</script>

<style lang="less"></style>
